package Hxw3DEngine.core.Resource.texture
{
	import Hxw3DEngine.core.Resource.IResourceAtom;
	import Hxw3DEngine.error.ErrorType;
	import Hxw3DEngine.proxy.Stage3DProxy;
	
	import flash.display3D.Context3D;
	import flash.display3D.Context3DTextureFormat;
	import flash.display3D.textures.TextureBase;

	public class ResourceTexture implements IResourceAtom
	{
		//=======================gpu纹理模式枚举
		/** 倍增常量插值 */
		public static const MAG_NEAREST 	: String = 'nearest';
		/** 倍增线性插值 */
		public static const MAG_LINEAR 		: String = 'linear';
		/** clamp寻址模式 */
		public static const WRAP_CLAMP 		: String = 'clamp';
		/** repeat寻址模式 */
		public static const WRAP_REPEAT 	: String = 'repeat';
		/** 2d纹理格式 */
		public static const TYPE_2D 		: String = '2d';
		/** cube纹理格式 */
		public static const TYPE_CUBE 		: String = 'cube';
		/** 不启用MIP */
		public static const MIP_NONE 		: String = 'mipnone';
		/** 常量MIP插值 */
		public static const MIP_NEAREST 	: String = 'mipnearest';
		/** 线性MIP插值 */
		public static const MIP_LINEAR 		: String = 'miplinear';
		
		
		//=========================纹理模式================================
		/** 倍增模式 */
		public var magMode  	: String = MAG_LINEAR;
		/** 寻址模式 */
		public var wrapMode		: String = WRAP_REPEAT;
		/** 缩减模型 */
		public var mipMode		: String = MIP_LINEAR;
		/** 纹理格式 */
		public var typeMode		: String = TYPE_2D;
		/** 名称 */
		
		protected var _format:String = Context3DTextureFormat.BGRA;
		
		protected var _mipmap:Boolean = true;
		
		protected var _texture:TextureBase;
		
		protected var _width:int;
		
		protected var _height:int;
		
		public function get texture():TextureBase{
			return _texture;
		}
		
		public function set texture(val:TextureBase):void {
			_texture = val;
		}

		
		public function get mipmap():Boolean 
		{
			return _mipmap;
		}
		
		public function set mipmap(value:Boolean):void 
		{
			_mipmap = value;
		}
		
		public function get format():String 
		{
			return _format;
		}
		
		public function set format(value:String):void 
		{
			_format = value;
		}
		
		
		//-------------------implements--------------------------
		
		public function createFromVO(vo:Object):Boolean
		{
			throw new Error(ErrorType.OVERRIDE_ERROR);
		}
		
		
		public function dispose():void {
			
		}

		public function get width():int
		{
			return _width;
		}
		
		public function get height():int
		{
			return _height;
		}

		
	}
}